package com.coldchain.common.enums;

import com.baomidou.mybatisplus.core.enums.IEnum;

public enum  DistributionsStatusEnum implements IEnum<Integer> {
    WAIT_DISPATCH(1,"待调派"),
    /**
     * 配送订单状态
     */
    WAIT_PICK(2,"待取货"),

    /**
     * 配送点状态取货点也是待送达
     */
    WAIT_DELIVER(3,"待送达"),
    REVOLVE_ING(4,"转单中"),
    REVOLVE_FINISH(4,"已转单"),
    FINISH(5,"配送完成"),
    ERROR(-1,"配送失败");
    private int status;
    private String desc;

    public static DistributionsStatusEnum getStatus(int status){
        for (DistributionsStatusEnum st:DistributionsStatusEnum.values()) {
            if(st.status==status){
                return st;
            }
        }
        return null;
    }
    DistributionsStatusEnum(int status, String desc) {
        this.status = status;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return status;
    }
}
